﻿namespace CoreEx.Common.Validation
{
    /// <summary>
    /// Represents a class that is capable of validation a single property.
    /// </summary>
    /// <typeparam name="T">The target type to validate.</typeparam>
    public interface IPropertyValidator<T>
    {
        /// <summary>
        /// Validates a single property identified by <paramref name="propertyName"/> 
        /// </summary>
        /// <param name="target">The target instance to validate.</param>
        /// <param name="propertyName">The target property to validate.</param>
        /// <returns>A <see cref="string"/> that contains a textual representation of the broken rule, if any.</returns>
        string Validate(T target, string propertyName);
    }

}
